package Io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream f =new FileOutputStream("./123_2.jpg");//复制地址
        FileInputStream f1 = new FileInputStream("./123.jpg");//源地址
        byte [] b = new byte[1024];
        int l;
        long a = System.currentTimeMillis();
        while((l = f1.read(b))!=-1){
            f.write(b,0,l);
        }
        long c = System.currentTimeMillis();
        System.out.println("时间损耗"+(c-a));
        f.close();
        f1.close();
    }
}
